home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4117 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: andrew.cmu.edu!ro2m+
  2. From: Randy O'Reilly <oreilly+@CMU.EDU>
  3. Newsgroups: gnu.emacs.help,comp.lang.c++
  4. Subject: C++ Editing Idea: Already Available?
  5. Date: Sat, 27 Jan 1996 20:01:05 -0500
  6. Organization: Doctoral student, Psychology, Carnegie Mellon, Pittsburgh, PA
  7. Message-ID: <8l2gfFO00jW=Q6ZoBO@andrew.cmu.edu>
  8. NNTP-Posting-Host: po9.andrew.cmu.edu
  9.  
  10. Having developed a large C++ library for doing neural network
  11. simulation, we have found that the main problem people face in using
  12. it to develop their own code could be solved by a smart editor that
  13. has the following features.  I would like to know if something like
  14. this is already available for UNIX systems, preferably in emacs.  If
  15. not, anybody want to write this in elisp?  Thanks in advance for any
  16. info! 
  17.  
  18.                 - Randy
  19.  
  20. Problem: Can't tell what a function *really* does because it calls
  21. parent version of function, or member functions:
  22.  
  23. void BpUnit::Compute_Act() {
  24.   Unit::Compute_Act();   // do standard activation computation
  25.   act += rnd_noise.Gen(); // add random noise
  26. }
  27.  
  28. Solution: If one could double-click (or whatever) on the
  29. 'Unit::Compute_Act()' call above and get something like the following
  30. display:
  31.  
  32. void BpUnit::Compute_Act() {
  33.   Unit::Compute_Act(); {  // defined at: ../pdp/netstru.cc:320
  34.     act = 1.0 / (1.0 + exp(-net));
  35.   }
  36.   act += rnd_noise.Gen(); // add random noise
  37. }
  38.  
  39. which simply provides the definition of the parent function *inline*
  40. in the code (presumably protected from editing, but visible, probably
  41. in a different color or otherwise hilighted as such) and automatically
  42. commented with the location of this in some other source file (which
  43. could then be clicked on to get to the actual source file to edit it).
  44.  
  45. this could be done with all function calls (on any object, etc):
  46.  
  47. void BpUnit::Compute_Act() {
  48.   Unit::Compute_Act(); {  // defined at: ../pdp/netstru.cc:320
  49.     act = 1.0 / (1.0 + exp(-net));
  50.   }
  51.   act += rnd_noise.Gen(); { // defined at: ../ta_misc/random.h:53
  52.     return (drand48() * var) + mean;
  53.   }
  54. }
  55.  
  56. after viewing the function definition, another double-click would
  57. revert to the actual text of the current function, etc. 
  58.  
  59. the ability to view code *inline* instead of having to flip back and
  60. forth over 10's of source files is the key to making this useful --
  61. the tags facility in emacs, while better than nothing, does not allow
  62. one to see in one place exactly what is happening, which is so often
  63. useful for people to figure out what you wrote and how they can use
  64. that to suit their own needs. flipping back and forth and trying to
  65. keep things in memory just doesn't work very well.
  66.  
  67.